import Vue from 'vue'
import VueRouter from 'vue-router'
// // // import Home from '../views/Home.vue'
import Home from '../views/Home'
import Frients from '../views/Frients'
import Cart from '../views/Cart'
import Search from '../views/Search'
import NewsList from '../views/Home/news/NewsList'
import NewsInfo from '../views/Home/news/NewsInfo'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/frients',
    component: Frients
  },
  {
    path: '/cart',
    component: Cart
  },
  {
    path: '/search',
    component: Search
  },
  {
    path: '/home/newslist',
    component: NewsList
  },
  {
    path: '/home/newsinfo/:id',
    component: NewsInfo
  }

//   // {
//   //   path: '/',
//   //   name: 'Home',
//   //   component: Home
//   // },
//   // {
//   //   path: '/about',
//   //   name: 'About',
//   //   // route level code-splitting
//   //   // this generates a separate chunk (about.[hash].js) for this route
//   //   // which is lazy-loaded when the route is visited.
//   //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
//   // }
]

const router = new VueRouter({
  routes
})

export default router
